<template>
  <!-- 设置一行，默认24个格子 gutter是每个col的间隔 -->
  <el-row class="Home" :gutter="20">
    <!-- 设置此列占8格 -->
    <el-col :span="8" style="margin-top: 20px">
      <el-card shadow="hover">
        <div class="user">
          <img :src="userImg" />
          <div class="userInfo">
            <p class="name">Admin</p>
            <p class="access">超级管理员</p>
          </div>
        </div>
        <hr />
        <div class="loginInfo">
          <p>上次登录的时间：<span>2022-9-23</span></p>
          <p>上次登录的地点：<span>武汉</span></p>
        </div>
      </el-card>

      <el-card shadow="hover" style="margin-top: 20px;">
        <el-table
          :data="tableData"
          stripe
          style="overflow: hidden"
        >
          <el-table-column prop="date" label="日期" width="180">
          </el-table-column>
          <el-table-column prop="name" label="姓名" width="180">
          </el-table-column>
          <el-table-column prop="address" label="地址"> </el-table-column>
        </el-table>
      </el-card>
    </el-col>

    <!-- 设置此列占16格 -->
    <el-col :span="16" style="margin-top: 20px">
      <el-card shadow="hover">
        <p>呼唤</p>
      </el-card>
    </el-col>
  </el-row>
</template>

<script>
export default {
  name: "Index",
  data() {
    return {
      userImg: require("../../assets/头像.jpg"),
      tableData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
      ],
    };
  },
};
</script>

<style scoped>
.user,
.loginInfo {
  /* background: pink; */
  width: 100%;
  height: 50%;
}
.user img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}
.user .userInfo {
  position: relative;
  left: 90px;
  top: -59px;
}
.loginInfo {
  position: relative;
  top: -10px;
}
hr {
  position: relative;
  top: -10px;
}
</style>